﻿using System;
using Microsoft.Practices.EnterpriseLibrary.Data;
using Microsoft.Practices.EnterpriseLibrary.Data.Sql;
using System.Configuration;

namespace Founder.PKURG.CRMCommon
{
    /// <summary>
    /// Common Config
    /// </summary>
    public class CommonConstants
    {
        /// <summary>
        ///  CRM Connect String
        /// </summary>
        public static Database DB_FOUNDER_MSCRM
        {
            get
            {
                string connectionString = CommonOperator.ReadXML("DB_FOUNDER_MSCRM");
                return new SqlDatabase(connectionString);
            }
        }

        /// <summary>
        ///  AddOn DataBase Connect String
        /// </summary>
        public static Database DB_FOUNDER_ADDON
        {
            get
            {
                string connectionString = CommonOperator.ReadXML("DB_FOUNDER_ADDON");
                //CommonOperator.WriteLog(connectionString);
                return new SqlDatabase(connectionString);
            }
        }

        /// <summary>
        /// Connect CRM use IFD flag
        /// </summary>
        public static string SERVICE_FOUNDERCRM_ISIFD
        {
            get
            {
                return CommonOperator.ReadXML("IsIFD");

            }
        }

        /// <summary>
        ///  CRM IFD  OrgServiceUri
        /// </summary>
        public static string SERVICE_FOUNDERCRM_IFDORGSERVICEURI
        {
            get
            {
                return CommonOperator.ReadXML("IFDOrgSerivceUri");
                
            }
        }

        /// <summary>
        /// CRM IFD  user name
        /// </summary>
        public static string SERVICE_FOUNDERCRM_IFDUSERNAME
        {
            get
            {
                return CommonOperator.ReadXML("IFDUserName");

            }
        }

        /// <summary>
        /// CRM IFD  user password
        /// </summary>
        public static string SERVICE_FOUNDERCRM_IFDUSERPASSWORD
        {
            get
            {
                return CommonOperator.ReadXML("IFDUserPassword");

            }
        }


        /// <summary>
        /// CRM IFD  dommin name
        /// </summary>
        public static string SERVICE_FOUNDERCRM_IFDDOMAINNAME
        {
            get
            {
                return CommonOperator.ReadXML("IFDDomainName");

            }
        }


        /// <summary>
        /// CRM  orgservice uri
        /// </summary>
        public static string SERVICE_FOUNDERCRM_CRMORGSERVICEURI
        {
            get
            {
                return CommonOperator.ReadXML("CRMOrgServiceUri");

            }
        }

        /// <summary>
        /// CRM  admin user name
        /// </summary>
        public static string SERVICE_FOUNDERCRM_CRMUSERNAME
        {
            get
            {
                return CommonOperator.ReadXML("CRMUserName");

            }
        }

        /// <summary>
        ///  CRM  admin user password
        /// </summary>
        public static string SERVICE_FOUNDERCRM_CRMUSERPASSWORD
        {
            get
            {
                return CommonOperator.ReadXML("CRMUserPassword");

            }
        }


        /// <summary>
        ///  CRM   user domin name
        /// </summary>
        public static string SERVICE_FOUNDERCRM_CRMUSERDOMINNAME
        {
            get
            {
                return CommonOperator.ReadXML("CRMUserDomainName");

            }
        }
    }
}